package cn.ticket.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import cn.ticket.model.Staff;

@Repository
@Transactional
public interface StaffMapper {
	int deleteByPrimaryKey(Integer id);

	int insert(Staff record);

	int insertSelective(Staff record);

	Staff selectByPrimaryKey(Integer id);

	int updateByPrimaryKeySelective(Staff record);

	int updateByPrimaryKey(Staff record);

	int getStaffCount();

	int getStaffCountByDepartment(@Param("departmentId") Integer departmentId);

	List<Map<String, Object>> getStaffInfoByDepartmentAndCount(@Param("departmentId") Integer departmentId, @Param("start") int start,
			@Param("count") int count);

	List<Staff> getAll();

	List<Staff> getByCount(@Param("start") int start, @Param("count") int count);

	List<Staff> getByDepartment(@Param("departmentId") Integer departmentId);

	Staff getByPhoneAndPassword(@Param("phone") String phone, @Param("password") String password);
	
	Staff getByNumberAndPassword(@Param("number") String number, @Param("password") String password);

	Staff getByIdAndPassword(@Param("id") Integer id, @Param("password") String password);

	List<Map<String, Object>> getByKeywords(@Param("keywords") String keywords);
	
	List<Map<String, Object>> getStaffByKeyWords(@Param("keywords") String keywords);

	List<Map<String, Object>> getStaffInfoByCount(@Param("start") int start, @Param("count") int count);

	List<Map<String, Object>> getStaffInfoByDepartment(@Param("departmentId") Integer departmentId);
	
	List<Map<String, Object>> getAuditingStaffInfoByDepartmentId(@Param("departmentId") Integer departmentId);

	List<Map<String, Object>> getStaffInfoByStaffId(@Param("staffId") Integer staffId);
}